debugString('initializing simulated data...'); //this line print customized string

var list = {
	'temperature_cook': 100,
	'temperature_air': 50,
	'pressure_cook': 80,
	'weight_cook': 10,
	'part_a': 100,
	'part_b': 100,
	'part_c': 100,
	'part_d': 100
};

for (var i in list) {
	var data = getTag(i) || Math.random() * list[i];
	data = getProcessData(data, list[i]);
	setTag(i, data);
	//debugTag(i); //this line print value of tag in debugging mode.
}

function getProcessData(prev, range) {
	var rnd = Math.random() * 5;
	if ((prev + rnd) > range) {
		rnd = prev - rnd;
	}
	else {
		rnd = prev + rnd;
	}
	return rnd;
}
//Data for horizontal Report
var fakeData = {
	'RH01': 100,
	'TT01': 100,
	'PT01': 100,
	'PT02': 100,
	'RH02': 100,
	'TT02': 100,
	'TT03': 100,
	'TT04': 100,
	'TT05': 100,
	'TT06': 100,
	'PT03': 100,
	'PT04': 100,
	'PT05': 100,
	'PT06': 100,
	'WS01': 100,
	'WS02': 100,
	'WS03': 100,
	'WS04': 100,
	'PT07': 100,
	'LT01': 100,
	'FS01': 100,
	'FT01': 100,
	'FV01': 100,
	'FS02': 100,
	'FT02': 100,
	'FV02': 100,
	'FS03': 100,
	'FT03': 100,
	'FV03': 100,
	'FS04': 100,
	'FT04': 100,
	'FV04': 100
};

for (var i in fakeData) {
	var data = fakeData[i] + (fakeData[i] * 0.2 * Math.random());
	setTag(i, data);
}

var dummylist = {
	'dummyText': 'KWH Per Day'
};

for (var i in dummylist) {
	setTag(i, dummylist[i]);
}

///// Report Data End /////
setTag("BURNER1_ON",getTag("DRY1_4_BUR01_ON"));
setTag("BURNER2_ON",getTag("DRY2_5_BUR1"));
setTag("BURNER3_ON",getTag("DRY2_5_BUR2"));
setTag("BURNER4_ON",getTag("DRY3_6_BUR01"));

// Warning for washing
var printerSwitch = getTag("S7_200_M5_1");
var printerTimerSwitch = getTag("S7_200_M5_TIMING_SWITCH");
var printerTimer = getTag("S7_200_M5_TIMING");
var printerAlert = getTag("S7_200_M5_ALERT");
if(printerSwitch === true){
	setTag("S7_200_M5_TIMING_SWITCH", true);
}
if(printerTimerSwitch===true && printerSwitch === false){
	setTag("S7_200_M5_TIMING", printerTimer + 1);
}
if(printerTimer >= 480){
	setTag("S7_200_M5_TIMING_SWITCH", false);
	setTag("S7_200_M5_ALERT", true);
	setTag("S7_200_M5_TIMING", 0);
}
